package java_class_work.week03;

interface InterfaceA {
    int method01(int a, int b);
}

/**
 * Lambda 表达式
 */
public class Lambda {
    public static void main(String[] args) {
        //lambda 表达式，优势：更简洁
        InterfaceA interfaceA = (a, b) -> a + b;
        // 匿名内部类
        InterfaceA interfaceB = new InterfaceA() {
            @Override
            public int method01(int a, int b) {
                return a+b;
            }
        };
        //二者效果等价
        System.out.println(interfaceA.method01(89, 25));
        System.out.println(interfaceB.method01(89, 25));
    }
}
